package com.xiaoy.javamaildemo.formwork.javamail;


import com.xiaoy.javamaildemo.enums.FolderTypeEnum;

import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.mail.search.SearchTerm;
import java.util.List;

public interface IMail {

    VevorMimeMessageBo getMessage(long messageNum) throws Exception;

    VevorMimeMessageBo getMessage(FolderTypeEnum folderTypeEnum, long messageNum) throws Exception;

    List<VevorMimeMessageBo> pull() throws Exception;

    List<VevorMimeMessageBo> pull(FolderTypeEnum folderTypeEnum, SearchTerm searchTerm) throws Exception;

    void sendMail(MimeMessage mimeMessage) throws Exception;

    Long createDrafts(MimeMessage mimeMessage) throws Exception;

    Long createDraftReply(long messageId,MimeMessage mimeMessage) throws Exception;

    Long updateDrafts(MimeMessage mimeMessage,long draftId) throws Exception;

    void deleteDrafts(long draftId) throws Exception;

    void sendDraft(long draftId) throws Exception;

    void reply(long messageId,MimeMessage mimeMessage) throws Exception;

    Session getSession() throws Exception;
}
